package com.right.service.impl;

import java.util.List;

import com.right.dao.FoodstypeDao;
import com.right.dao.impl.FoodstypeDaoImpl;
import com.right.entity.Foodstype;
import com.right.service.FoodsTypeService;

public class FoodsTypeServiceImpl implements FoodsTypeService {
	FoodstypeDao ftd = new FoodstypeDaoImpl();
	@Override
	public boolean addFoodsType(Foodstype foodstype) {
		if(foodstype==null) {
			return false;	
		}
		Foodstype ft = ftd.getFoodsTypeByName(foodstype.getTypename());
		if(ft!=null) {
			return false;
		}
		return ftd.addFoodsType(foodstype);
	}

	@Override
	public boolean delFoodsType(int typeid) {
		return ftd.delFoodsType(typeid);
	}

	@Override
	public boolean updateFoodsType(Foodstype foodstype) {
		if(foodstype==null) {
			return false;
		}
		return ftd.updateFoodsType(foodstype);
	}

	@Override
	public List<Foodstype> getFoodsType(String keywords) {
		// TODO Auto-generated method stub
		return ftd.getFoodsType("");
	}

}
